import agentHttp from '@/utils/agentHttp'    //请求方法
import pagination from '@/views/pagination'  //分页组件
import dialogForm from './edit'
export default {
  components:{dialogForm,pagination},
  name: 'addVehicleInfo',
  created(){ 
      this.seachData();
  },
  data() {
  	return {
      //搜索字段
  		searchForm:{},
      //表格字段
      tableData: [{}],
      //弹窗状态数据
      dialogSendData:{
        isAdd:"",
        dialogFormVisible:"",
        id:""
      },
      formLabelWidth:'120px',
      carOrderStatusMap:''
  	}
  },
  methods: {
    seachData(){
      var params=this.searchForm||{};
      params.page=this.tableData.page||1;
      params.rows=this.tableData.rows||10;
      agentHttp.postJson('adminApi/admin/car_inspection_info_add/list?page='+params.page+'&rows='+params.rows,params ).then((data)=>{
        if(data.success){
          this.tableData = data.data.tableData;
          this.carOrderStatusMap = data.data.carOrderStatusMap;
        }
      })
    },
    //新增、编辑
    handleEdit(index, row){
      row?this.dialogSendData.id=row.id:this.dialogSendData.id="";
      this.dialogSendData.isAdd=true;
      this.dialogSendData.dialogFormVisible=true;
    }   
  }
}
